import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:lib_common/utils/color_utils.dart';

void main() {
  group("测试颜色转换", () {
    test("测试颜色转换1", () {
      var color = "#678".color;
      expect(color, const Color(0xFF667788));
    });
    test("测试颜色转换2", () {
      var color = "#5678".color;
      expect(color, const Color(0x55667788));
    });
    test("测试颜色转换3", () {
      var color = "#667788".color;
      expect(color, const Color(0xFF667788));
    });
    test("测试颜色转换4", () {
      var color = "#55667788".color;
      expect(color, const Color(0x55667788));
    });
  });
  group("测试颜色格式", () {
    test("测试颜色格式1", () {
      var color = "#F678".color;
      expect(color, const Color(0xFF667788));
    });
    test("测试颜色格式2", () {
      var color = "#f678".color;
      expect(color, const Color(0xFF667788));
    });
    test("测试颜色格式3", () {
      var color = "#F678".color;
      expect(color, const Color(0xFF667788));
    });
    test("测试颜色格式4", () {
      var color = "#f56789".color;
      expect(color, const Color(0xFF667788));
    });
    test("测试颜色格式5", () {
      var color = "#f456789".color;
      expect(color, const Color(0x0F456789));
    });
  });
}
